<?php $this->load->view('header', $head) ?>

<div data-role="page" id="page-search">
	<div data-role="header">
		<h1>설문 검색</h1>
	</div>
	<div data-role="content">
		<?=form_open('poll/search', array('method' => 'get'))?>
		<ul data-role="listview" <?=$this->agent->is_mobile()?'':'data-inset="true"'?>>
			<li data-role="list-divider">일반 조건</li>
			<li data-role="fieldcontain">
				<label for="category">카테고리</label>
				<?=category_selector()?>
			</li>
			<li data-role="fieldcontain">
				<label for="keyword">키워드</label>
				<input type="text" id="keyword" name="keyword"/>
			</li>
			<li data-role="fieldcontain">
				<label for="title">제목</label>
				<input type="text" id="title" name="title"/>
			</li>
			<li data-role="fieldcontain">
				<label for="flip-search-expired">만료된 설문 검색</label>
				<select name="search-expired" id="flip-search-expired" data-role="slider">
					<option value="0">Off</option>
					<option value="1">On</option>
				</select> 
			</li>
			<li data-role="fieldcontain">
				<label for="flip-search-detail">상세검색</label>
				<select name="flip-search-detail" id="flip-search-detail" data-role="slider">
					<option value="0">Off</option>
					<option value="1">On</option>
				</select> 
			</li>
			<li data-role="list-divider" class="search-detail-field">상세검색 조건</li>
			<li data-role="fieldcontain" class="search-detail-field">
				<label for="location">위치</label>
				<input type="text" id="location" name="location"/>
			</li>
			<li data-role="fieldcontain" class="search-detail-field">
				<fieldset data-role="controlgroup" class="address-selector">
					<legend class="field-label">거주지:</legend>
					<label for="address1">도/시</label>
					<?=form_dropdown('address_id[]', $address[0], set_value('address_id[0]'), 'id="address1"')?>
					<label for="address2">시/군/구</label>
					<?=form_dropdown('address_id[]', $address[1], set_value('address_id[1]'), 'id="address2"')?>	
					<label for="address3">동/읍/면</label>
					<?=form_dropdown('address_id[]', $address[2], set_value('address_id[2]'), 'id="address3"')?>
				</fieldset>
			</li>
			<li data-role="fieldcontain" class="search-detail-field">
				<fieldset data-role="controlgroup" data-type="horizontal">
					<legend class="field-label">
						최종학력:
					</legend>
					<?=form_education_selector()?>
				</fieldset>
				<?=form_error('education')?>
			</li>
			<li data-role="fieldcontain" class="search-detail-field">
				<fieldset data-role="controlgroup" data-type="horizontal">
					<legend class="field-label">
						성별:
					</legend>
					<input type="radio" value="male" name="gender" id="radio-gender-male" <?=set_radio('gender', 'male')?>)/>
					<label for="radio-gender-male">남</label>
					<input type="radio" value="female" name="gender" id="radio-gender-female" <?=set_radio('gender', 'female')?>/>
					<label for="radio-gender-female">여</label>
				</fieldset>
				<?=form_error('gender')?>
			</li>
			
			<li data-role="fieldcontain" class="search-detail-field">
				<label for="age_range" class="field-label">연령:</label>
				<select name="age_range" id="age_range">
					<option value="">선택하세요</option>
					<option value="10">10대</option>
					<option value="20">20대</option>
					<option value="30">30대</option>
					<option value="40">40대</option>
					<option value="50">50대</option>
					<option value="60">60대</option>
					<option value="70">70대</option>
					<option value="80">80대</option>
					<option value="90">90대이상</option>
				</select>
			</li>
			<li data-role="list-divider"></li>
			<li>
				<div>
					<input type="submit" value="검색">
				</div>
			</li>
		</ul>
		<?=form_close()?>
	</div>
	<div data-role="footer" data-position="fixed">
		<?=$this->load->view('navbar', array('active' => 'search'))?> 
	</div>
</div>

<?php $this->load->view('footer'); ?>
